<template>
    <div>
        <el-input disabled :value="$route.query.roleName"></el-input>
        <el-tree :data="data" show-checkbox node-key="id" :default-expanded-keys="[2, 3]" :default-checked-keys="[5]"
            :props="defaultProps">
        </el-tree>
    </div>
</template>
<script>1
export default {
    data() {
        return {
            data: [],
            defaultProps: {
                children: 'children',
                label: 'name'
            }
        }
    },
    mounted() {
        // console.log(this.$route);
        let id = this.$route.params.id
        // console.log(id);
        this.getRole(id)
    },
    methods: {
        async getRole(id) {
            let result = await this.$API.permission.toAssign(id)
            console.log(result);
            this.data = result.data.children
        },
    },
}
</script>

<style scoped>

</style>